package ma.view.gui.parameterPanels;

import java.util.List;

import javax.swing.BorderFactory;
import javax.swing.JLabel;
import javax.swing.JPanel;

import net.miginfocom.swing.MigLayout;

public abstract class OutputPanel extends ParameterPanel {

    private static final long serialVersionUID = 1L;    
    
    public OutputPanel(
            String logoPath,
            String panelTitle) {
        super(logoPath, panelTitle);
    }
    
    @Override
    /*
     * (non-Javadoc)
     * @see ma.view.gui.parameterPanels.ParameterPanelsPanel#addParameterPanel(java.lang.String[])
     */
    public void addParameterPanel(String[] parameterInformation) {        
        JPanel parameterPanel = new JPanel(new MigLayout("wrap 4"));
        parameterPanel.add(new JLabel(parameterInformation[0]));            
        parameterPanel.add(new JLabel(parameterInformation[1]));
        parameterPanel.add(new JLabel(parameterInformation[2]));
        parameterPanel.add(new JLabel(parameterInformation[3]));
        parametersPanel.add(parameterPanel);
    }
    
    @Override
    /*
     * (non-Javadoc)
     * @see ma.view.gui.parameterPanels.ParameterPanelsPanel#addParameterPanel(java.util.List, java.lang.String)
     */
    public void addParameterPanel(
            List<String[]> parametersInformation, String borderTitle) {
                    
        JPanel parameterPanel = new JPanel(new MigLayout("wrap 4"));
        //Iterate through every parameter of this set.
        parameterPanel.setBorder(BorderFactory
                .createTitledBorder(borderTitle));
        for(String[] parameter : parametersInformation) {
            parameterPanel.add(new JLabel(parameter[0]));            
            parameterPanel.add(new JLabel(parameter[1]));
            parameterPanel.add(new JLabel(parameter[2]));
            parameterPanel.add(new JLabel(parameter[3]));                
        }
        parametersPanel.add(parameterPanel);
    }
}
